package cn.com.blueInfo.bpm.template.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.template.entity.File;
import cn.com.blueInfo.bpm.template.request.FileDTO;
import cn.com.blueInfo.bpm.template.response.FileVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 流程附件管理表 对象转换
 * @author suxch
 * @since 2025-08-31 16:23:18
 */
@Mapper(componentModel = "spring")
public interface FileConvert
        extends BaseConvert<File, FileDTO, FileVO> {

    File dtoToEntity(FileDTO dto);

    File dtoToEntity(FileDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    FileVO entityToVO(File entity);

}